const user = {
  namespaced: true,
  state: {
    nickName: '',
    avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
    token: '',
    role: ''
  },
  mutations: {
    changeState (state, payload) {
      const { nickName, avatar, token, role } = payload
      state.nickName = nickName
      state.avatar = avatar
      state.token = token
      state.role = role
    },
    clearState (state) {
      state.nickName = ''
      state.avatar = 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png'
      state.token = ''
      state.role = ''
    }
  },
  actions: {
  }
}

export default user
